package de.hfu.helper;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Helper {
	
	public static final int MILLIS_IN_DAY = 1000 * 60 * 60 * 24;
	public static final float DELTA = (float) 0.01;
	
	public static boolean isEqual(Date d1, Date d2) {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
		String t1 = sdf.format(d1);
		String t2 = sdf.format(d2);
		return t1.equalsIgnoreCase(t2);
	}
	
	public static boolean isEqual(float n1, float n2) {
		return Math.abs(n1 - n2) < DELTA;
	}
}
